import React, {Component} from 'react';
import PropTypes from 'prop-types';
import List from '../list/List.jsx';

class TodoList extends Component {

  constructor(props) {
    super(props);
  }

  static propTypes = {
    text: PropTypes.string,
    defaultChecked: PropTypes.bool,
    index: PropTypes.number,
    listContent: PropTypes.array
  }

  static defaultProps = {

  }

  render() {

    return (
      <div>
        {
          this.props.listContent.map(function(item, key) {
            return (
              <div key = {key}>
                <List
                  text = {item.text}
                  index = {item.id}
                  defaultChecked = {item.checked}/>
              </div>
            );
          }, this)
        }
      </div>
    );
  }
}


export default TodoList;
